How to Research a String in Visio?

Hello everybody,

 

I am trying to write a DXL script to find a string in an OLE object. I was able to find the methods for Word and Excel, but not for Visio.

 

Does anyone have a hint for me?

 

Thanks :)


john29 - Mon Jun 08 06:26:35 EDT 2015

Re: How to Research a String in Visio?
Wolfgang Uhr - Mon Jun 08 08:07:29 EDT 2015

What do you understand by "methods for Word and Excel"?

Re: How to Research a String in Visio?
john29 - Mon Jun 08 08:19:21 EDT 2015

Wolfgang Uhr - Mon Jun 08 08:07:29 EDT 2015

What do you understand by "methods for Word and Excel"?

What I mean by this is that I found how to use oleGet, oleMethod and olePut to search for some text into Word and Excel.

Inside the vba object explorer I could find the classes and the members to use to perform this research, but for Visio I was not able to find it...do you know how to handle this?

Thanks!

Re: How to Research a String in Visio?
Wolfgang Uhr - Mon Jun 08 10:07:05 EDT 2015

john29 - Mon Jun 08 08:19:21 EDT 2015

What I mean by this is that I found how to use oleGet, oleMethod and olePut to search for some text into Word and Excel.

Inside the vba object explorer I could find the classes and the members to use to perform this research, but for Visio I was not able to find it...do you know how to handle this?

Thanks!

Ok, you did not find a string an an ole object, you used the automatisation object and the application itself. But there is no difference between Word, Excel and Visio?

 

https://support.microsoft.com/de-de/kb/309603/en-us

Re: How to Research a String in Visio?
john29 - Mon Jun 08 10:18:56 EDT 2015

Wolfgang Uhr - Mon Jun 08 10:07:05 EDT 2015

Ok, you did not find a string an an ole object, you used the automatisation object and the application itself. But there is no difference between Word, Excel and Visio?

 

https://support.microsoft.com/de-de/kb/309603/en-us

Yes, there is a difference:

- Word:

                oleGet(objApp, "Selection", objSelection)
                oleGet(objSelection, "Find", objFind)
                oleMethod(objFind, "ClearFormatting")
                olePut(objFind, "Text", StringToFind)
                oleMethod(objFind, "Execute")
                oleGet(objFind, "Found", Result)

 

- Excel:
                oleGet(objApp, "Cells", objCells)
                clear objArgs
                put(objArgs, "What", StringToFind)
                put(objArgs, "LookIn", xlFormulas)
                oleMethod(objCells, "Find", objArgs, objCell)

- Visio: ???

 

If someone could help me here it would be great :)

 

 

Re: How to Research a String in Visio?
Wolfgang Uhr - Mon Jun 08 11:07:38 EDT 2015

john29 - Mon Jun 08 10:18:56 EDT 2015

Yes, there is a difference:

- Word:

                oleGet(objApp, "Selection", objSelection)
                oleGet(objSelection, "Find", objFind)
                oleMethod(objFind, "ClearFormatting")
                olePut(objFind, "Text", StringToFind)
                oleMethod(objFind, "Execute")
                oleGet(objFind, "Found", Result)

 

- Excel:
                oleGet(objApp, "Cells", objCells)
                clear objArgs
                put(objArgs, "What", StringToFind)
                put(objArgs, "LookIn", xlFormulas)
                oleMethod(objCells, "Find", objArgs, objCell)

- Visio: ???

 

If someone could help me here it would be great :)

 

 

https://support.microsoft.com/de-de/kb/309603/en-us

Re: How to Research a String in Visio?
john29 - Mon Jun 08 11:53:49 EDT 2015

Wolfgang Uhr - Mon Jun 08 11:07:38 EDT 2015

https://support.microsoft.com/de-de/kb/309603/en-us

I have been through this link already, but it does not help me for my DXL script. I found only help for Word and Excel, which makes me wonder if the possibility of searching for some text in an OLE with DXL is supported?
 

Re: How to Research a String in Visio?
Wolfgang Uhr - Tue Jun 09 03:59:35 EDT 2015

john29 - Mon Jun 08 11:53:49 EDT 2015

I have been through this link already, but it does not help me for my DXL script. I found only help for Word and Excel, which makes me wonder if the possibility of searching for some text in an OLE with DXL is supported?
 

You are not through this link, let me refer from this link

Dim AppVisio As Visio.Application

   On Error Resume Next

   Set AppVisio = GetObject(, "visio.application")

   If AppVisio Is Nothing Then
      Set AppVisio = CreateObject("visio.application")
   End If
 

This handles Viso, not Word and not Excel.

 

For Word you write the dxl code:

OleAutoObj oleWord = oleGetAutoObject("Word.Application");

or

OleAutoObj oleWord = oleCreateAutoObject("Word.Application");

And for Visio you write

OleAutoObj oleWord = oleGetAutoObject("Visio.Application");

or

OleAutoObj oleWord = oleCreateAutoObject("Visio.Application");

And so on ...

Do you have any experience in Visual Basic for Applications? The whole Dxl-Ole-stuff is a vba-wrapper.

Re: How to Research a String in Visio?
john29 - Tue Jun 09 05:49:47 EDT 2015

Wolfgang Uhr - Tue Jun 09 03:59:35 EDT 2015

You are not through this link, let me refer from this link

Dim AppVisio As Visio.Application

   On Error Resume Next

   Set AppVisio = GetObject(, "visio.application")

   If AppVisio Is Nothing Then
      Set AppVisio = CreateObject("visio.application")
   End If
 

This handles Viso, not Word and not Excel.

 

For Word you write the dxl code:

OleAutoObj oleWord = oleGetAutoObject("Word.Application");

or

OleAutoObj oleWord = oleCreateAutoObject("Word.Application");

And for Visio you write

OleAutoObj oleWord = oleGetAutoObject("Visio.Application");

or

OleAutoObj oleWord = oleCreateAutoObject("Visio.Application");

And so on ...

Do you have any experience in Visual Basic for Applications? The whole Dxl-Ole-stuff is a vba-wrapper.

Sorry, when I said I could only find help for Word and Excel, I meant with all my online researches, I was not referring to your link.

Yes I have some experience in Visual Basic for Applications.

Actually in the Visual Basic Editor for Word and Excel it is easy to reach the right classes for the "Find" function, but for Visio I cannot find it, that is why I am wondering if this function exists for Visio...or maybe someone would know where to find it in the object browser?

 

 

 

Re: How to Research a String in Visio?
Wolfgang Uhr - Tue Jun 09 06:26:44 EDT 2015

john29 - Tue Jun 09 05:49:47 EDT 2015

Sorry, when I said I could only find help for Word and Excel, I meant with all my online researches, I was not referring to your link.

Yes I have some experience in Visual Basic for Applications.

Actually in the Visual Basic Editor for Word and Excel it is easy to reach the right classes for the "Find" function, but for Visio I cannot find it, that is why I am wondering if this function exists for Visio...or maybe someone would know where to find it in the object browser?

 

 

 

Hi

The refered document contains an chapter "Getting started" and this is exactly the thing you have to do.I for myself did not have the set of those libraries but the Microsoft Visio 14.0 Type Library and it works

Best regards

Wolfgang

 

Re: How to Research a String in Visio?
john29 - Tue Jun 09 09:45:49 EDT 2015

Wolfgang Uhr - Tue Jun 09 06:26:44 EDT 2015

Hi

The refered document contains an chapter "Getting started" and this is exactly the thing you have to do.I for myself did not have the set of those libraries but the Microsoft Visio 14.0 Type Library and it works

Best regards

Wolfgang

 

Hi,

I am trying to follow the steps described in this document, but I cannot find the Visio Property (to get from DXL oleGet Operation), the Visio Property Value (to set with DXL olePut Operation) and the Visio Method (to call with DXL oleMethod Operation) to use for a text Research in Visio.

 

I managed to record Macros in Word and Excel containing only a text research then translate those VBA Macros to DXL scripts, but when I try to record a similar Macro with Visio I get nothing recorded in my Macro, any idea why?

 

Thanks,

John

 

Re: How to Research a String in Visio?
Wolfgang Uhr - Tue Jun 09 10:14:49 EDT 2015

john29 - Tue Jun 09 09:45:49 EDT 2015

Hi,

I am trying to follow the steps described in this document, but I cannot find the Visio Property (to get from DXL oleGet Operation), the Visio Property Value (to set with DXL olePut Operation) and the Visio Method (to call with DXL oleMethod Operation) to use for a text Research in Visio.

 

I managed to record Macros in Word and Excel containing only a text research then translate those VBA Macros to DXL scripts, but when I try to record a similar Macro with Visio I get nothing recorded in my Macro, any idea why?

 

Thanks,

John

 

> I am trying to follow the steps described in this document, but I cannot find the Visio Property

Do you have a visio on your pc?

No? Sorry, you do not have any chance.